﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Model
{
    /// <summary>
    /// 游戏人物
    /// </summary>
    public class Characters
    {
        #region prvate data
        private string name;
        private Groups group;
        private Sexs sex;
        private int vipLevel;
        private int godCoin;
        private int sliveCoin;
        private int copperCoin;
        private int giftCertificate;
        private int level;
        private ulong exp;
        private Attributes attr;
        private Attributes extaAttr;
        private Attributes initiateAttr;
        private List<Equip> equips;
        private List<Items> ownItems;
        private int gridCount = 100;//人物背包空格数
        #endregion

        #region public fields
        /// <summary>
        /// 人物背包空格数
        /// </summary>
        public int GridCount
        {
            get { return gridCount; }
            set { gridCount = value; }
        }

        /// <summary>
        /// 人物携带的物品
        /// </summary>
        public List<Items> OwnItems
        {
            get { return ownItems; }
        }

        /// <summary>
        /// 人物装备
        /// </summary>
        public List<Equip> Equips
        {
            get { return equips; }
        }

        /// <summary>
        /// 人物原始属性
        /// </summary>
        public Attributes InitiateAttr
        {
            get { return initiateAttr; }
            set { initiateAttr = value; }
        }

        /// <summary>
        /// 装备宝石附加的属性
        /// </summary>
        public Attributes ExtaAttr
        {
            get { return extaAttr; }
            set { extaAttr = value; }
        }

        /// <summary>
        /// 人物总属性
        /// </summary>
        public Attributes Attr
        {
            get { return attr; }
        }

        /// <summary>
        /// 当前经验值
        /// </summary>
        public ulong Exp
        {
            get { return exp; }
            set { exp = value; }
        }

        /// <summary>
        /// 人物等级
        /// </summary>
        public int LV
        {
            get { return level; }
            set { level = value; }
        }

        /// <summary>
        /// 元宝数
        /// </summary>
        public int GodCoin
        {
            get { return godCoin; }
            set { godCoin = value; }
        }
        /// <summary>
        /// 银币数
        /// </summary>
        public int SliveCoin
        {
            get { return sliveCoin; }
            set { sliveCoin = value; }
        }
        /// <summary>
        /// 铜币数
        /// </summary>
        public int CopperCoin
        {
            get { return copperCoin; }
            set { copperCoin = value; }
        }
        /// <summary>
        /// 礼券数
        /// </summary>
        public int GiftCertificate
        {
            get { return giftCertificate; }
            set { giftCertificate = value; }
        }

        /// <summary>
        /// 角色名称
        /// </summary>
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        /// <summary>
        /// 所属阵营
        /// </summary>
        public Groups Group
        {
            get { return group; }
            set { group = value; }
        }

        /// <summary>
        /// 性别
        /// </summary>
        public Sexs Sex
        {
            get { return sex; }
            set { sex = value; }
        }

        /// <summary>
        /// VIP等级
        /// </summary>
        public int VipLevel
        {
            get { return vipLevel; }
            set { vipLevel = value; }
        }
        #endregion

        /// <summary>
        /// 创建人物
        /// </summary>
        public Characters()
        {
            this.equips = new List<Equip>(8);
            this.ownItems = new List<Items>(100);
        }

        /// <summary>
        /// 创建角色
        /// </summary>
        /// <param name="name"></param>
        public Characters(string name)
        {
            this.name = name;
        }
        /// <summary>
        /// 返回角色名
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return this.name;
        }
    }

    /// <summary>
    /// 阵营
    /// </summary>
    public enum Groups
    {
        /// <summary>
        /// 天族
        /// </summary>
        Heaven,
        /// <summary>
        /// 魔族
        /// </summary>
        Devil
    }

    /// <summary>
    /// 性别
    /// </summary>
    public enum Sexs
    {
        /// <summary>
        /// 女性
        /// </summary>
        Female,
        /// <summary>
        /// 男性
        /// </summary>
        Male
    }
}
